package hfjava;

public class Abs {
    public void  nums(int num){
        if (num>=0){
            System.out.println("绝对值为："+num);
        }else{
            System.out.println("绝对值为："+(-num));
        }
    }
    public void  nums(double num){
        if (num>=0){
            System.out.println("绝对值为："+num);
        }else{
            System.out.println("绝对值为："+(-num));
        }
    }
    public void nums(float num){
        if (num>=0){
            System.out.println("绝对值为："+num);
        }else{
            System.out.println("绝对值为："+(-num));
        }
    }
}
